<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        <!--
        body{
            padding: 0px;
            margin: 0px;
        }
        div{
            padding: 0px;
            margin: 0px;
            width: 1400px;
            height: 120px;
            border-bottom: solid 1px black;
            border-left:solid 1px black;

        }
        p{
            background-color: #F9FAED;
            margin: 0px;
        }
        #span1{
            position: relative;
            left: 20px;
        }
        #span2{
            position: relative;
            left: 960px;
        }
        #span2 img{
            position: relative;
            top:3px;
        }
       #picture{
            height: 60px;
            background-color:#D8E4C6 ;
           border-bottom: solid 1px black;
        }
        #picture img{
            position: relative;
            top:10px;
            left:20px;
           width: 80px;
           height: 40px;
       }
        #picture h3{
            position: relative;
            top:-38px;
            left: 100px;
            height:21px;
            width: 50px;
            padding: 0px 10px;
            border-left:dotted 2px black;
        }
        a{
            text-decoration: none;
        }
        a:link{
            color: blue;
        }
        a:visited{
            color: darkmagenta;
        }
        a:active{
            color: red;
        }
        -->
    </style>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        $(function () {
            var userName="${userName}";
            if(userName!=""){
                $("p").html("<span id=\"span1\"><b>"+userName+"&nbsp您好，欢迎光临当当网</b>[<a href=\"/userServlet?doType=doQuery&type=quit\" target=\"-self\">退出</a> ]</span>\n" +
                    "        <span  id=\"span2\"><a href=\"${pageContext.request.contextPath}/login/cartServlet?doType=doQuery\" target=\"-self\"><img src=\"${pageContext.request.contextPath}/images/gouwu.png\">购物车</a> |<a href=\"${pageContext.request.contextPath}/login/user.jsp\" target=\"-self\">我的当当</a>|<a href=\"\">帮助</a>| </span>\n" +
                    "    ")
            }else if(userName==""){
                $("p").html("<span id=\"span1\"><b>您好，欢迎光临当当网</b>[<a href=\"${pageContext.request.contextPath}/login.jsp\" target=\"-self\">登录</a> ][<a href=\"${pageContext.request.contextPath}/register.jsp\" target=\"-self\">注册</a>] </span>\n" +
                    "        <span  id=\"span2\"><a href=\"${pageContext.request.contextPath}/login/cartServlet?doType=doQuery\" target=\"-self\"><img src=\"${pageContext.request.contextPath}/images/gouwu.png\">购物车</a> |<a href=\"${pageContext.request.contextPath}/login/user.jsp\" target=\"-self\">我的当当</a>|<a href=\"\">帮助</a>| </span>\n" +
                    "    ")
            }
        })
    </script>
</head>
<body>
<div id="head">
    <p>
        <span id="span1"><b>您好，欢迎光临当当网</b>[<a href="${pageContext.request.contextPath}/login.jsp" target="-self">登录</a> ][<a href="${pageContext.request.contextPath}/register.jsp" target="-self">注册</a>] </span>
        <span  id="span2"><a href="${pageContext.request.contextPath}/login/cartServlet?doType=doQuery" target="-self"><img src="${pageContext.request.contextPath}/images/gouwu.png">购物车</a> |<a href="${pageContext.request.contextPath}/login/user.jsp">我的当当</a>|<a href="" target="-self">帮助</a>| </span>
    </p>
    <div id="picture">
        <a href="${pageContext.request.contextPath}/index.jsp" target="-self"> <img src="${pageContext.request.contextPath}/images/dang.png"></a><h3>图书</h3>
    </div>
</div>
</body>
</html>
